# settings
image_name="guyaqi-blog"
container_name="blog"
bind="8000"
dockerfile="./deploy/Dockerfile"

# update source code
git pull

# build static pages
npm run build

# stop
docker stop ${container_name}
docker rm ${container_name}
docker rmi ${image_name}

# start
docker build -f ${dockerfile} -t ${image_name} .
docker run -d -p ${bind}:80 --name ${container_name} ${image_name}

# end
